/*


编程式导航

const navigate = useNavigate()

navigate('/目标路径',{
    replace: true,
    state: 数据
})

navigate(-1)

路由传参

1. 路由参数 useParams()

2. location.state   const location = useLocation()

3. 查询字符串 useSearchParams()


useRoutes帮我们创建Routes和Route

useRoutes([
    {
        path: '路径',
        element: 组件实例
        children: [

        ]
    }
])

懒加载

import Home from './pages/Home'

const Home = React.lazy(()=>{ return import('./pages/Home')})

<Suspense fallback={node}>
    <懒加载的组件 />
</Suspense>


redux

import {createStore} from 'redux'

定义reducer函数

reducer的执行时机: 
1. 创建store的时候,执行,为了初始化数据
2. store.dispatch(action对象) 为了修改数据
function reducer(state=默认值,action){

    switch(action.type){

        case '':

            return {
                ...state,
                目标属性: 目标值
            }

        default: 
            return state
    }

}

const store = createStore(reducer)


store.getState()

store.subscribe()

store.dispatch()









*/
